package School;

/**
 * 定义普通人、老师、班主任、学生、学校5个类，每个类提供适当的成员变量和成员方法，
 * 要求具有良好的封装性，定义主类使之运行。
 */

class teacher extends common {
    public String subject;
    public String work_Place;
    public String work_Class;

    public teacher(String name, String sf, String home_Address, int age, String id, String phone_Number, String subject, String work_Place,String work_Class) {
        super(name, sf, home_Address, age, id, phone_Number);
        this.subject = subject;
        this.work_Place = work_Place;
        this.work_Class = work_Class;
    }

    @Override
    public String show_Info() {
        return super.show_Info() + ", 我所教授的课程为" + subject;
    }

    @Override
    public String toString() {
        return name + " 老师, 年龄 " + getAge() + "岁, 身份证号 " + getId() +
                ", 家庭住址 " + getHome_Address() + ", 联系方式 " + getPhone_Number()+", 在 " + work_Place+ work_Class + " 班级教授 " + subject + " 科目" ;
    }
}
